home *** CD-ROM | disk | FTP | other *** search
/ Amiga ISO Collection / AmigaUtilCD2.iso / Programming / C / hf^k-6.dms / in.adf / Install.run / GOLDEDDATA / developer / examples / scanner / source / a68k.c next >
Encoding:
C/C++ Source or Header  |  1996-08-30  |  1.1 KB  |  45 lines

  1. /* -----------------------------------------------------------------------------
  2.  
  3.   COPYIGHT
  4.  
  5.   ©1995  Dietmar  Eilert  (e-mail:  DIETMAR@TOMATE.TNG.OCHE.DE).  All  Rights
  6.   Reserved.  Code  may not be reused/reproduced without written permission of
  7.   the author.
  8.  
  9.   Dietmar Eilert
  10.   Mies-v-d-Rohe-Str.31, 52074 Aachen, Germany
  11.   E-Mail: DIETMAR@TOMATE.TNG.OCHE.DE
  12.   Tel: +49-(0)241-81665
  13.        +49-(0)2525-7776
  14.   Fax: +49-(0)241-81665
  15.  
  16.   Example: scan handler looking for assembler labes. Scan handlers are plain
  17.   functions (LoadSeg'ed by GED): no standard C startup code, no library calls.
  18.   
  19.   DICE-C:
  20.   
  21.   dcc a68k.c -// -l0 -md -mRR -o ram:a68k
  22.  
  23.   ------------------------------------------------------------------------------
  24. */
  25.  
  26. #include <exec/types.h>
  27.  
  28. ULONG
  29. ScanHandlerA68k(__D0 ULONG len, __A0 char **text, __A1 ULONG *line)
  30. {
  31.     const char *version = "$VER: A68k 1.0 (" __COMMODORE_DATE__ ")";
  32.  
  33.     while (len && (**text == 32)) {
  34.  
  35.         ++*text;
  36.         --len;
  37.     }
  38.  
  39.     if ((len > 1) && (**text == '_'))
  40.         return(len);
  41.     else
  42.         return(FALSE);
  43. }
  44.  
  45.